#include <stdio.h>
#include <vector>
#include <queue>
#include <map>

int main()
{
	// 1、从控制输入N个数字(用scanf)，存入stl的vector容器(push_back)，
	// 2、然后输出vector数组的大小
	// 3、并打印每一个元素(for循环)
	// 4、打印倒数第二个元素(用end()函数)
	// vector ---------------------------------------------------
	std::vector<int> my_array;
	printf("%lu\n",my_array.size());

	for (int i=0; i<10; i++) 
		my_array.push_back(i);
	printf("%lu\n",my_array.size());


	my_array.insert(my_array.end(),1,100);
	my_array.insert(my_array.begin()+2,1,100);

	printf("%lu\n",my_array.size());

	for (int i=0; i<12; i++) 
		printf("%d,",my_array[i]);
	

	my_array.erase(my_array.begin());
	my_array.erase(my_array.begin()+2);
	printf("\n");
	for (int i=0; i<10; i++) 
		printf("%d,",my_array[i]);
	printf("\n");
	printf("+++++++++++++++++++++++++++++++++++\n");

	// Map ---------------------------------------------------
	std::map<char,int> mymap;
	mymap['a']=101;
	mymap['b']=202;
	mymap['c']=303;

	printf("b => %d\n",mymap['b']);

	printf("Map size is %lu \n", mymap.size());
	mymap.erase ('c');	
	printf("Map size is %lu \n", mymap.size());
	
	if (mymap['z'] == NULL)
		printf("z => NULL\n"); 	
	
	// Queue ---------------------------------------------------
	std::queue<int> myqueue;
	int n;

	while(1) { 
		scanf("%d",&n);
		if (n==-1)
			break;
		myqueue.push (n);
	}

	printf("myqueue size : %lu\n",myqueue.size());

	while (!myqueue.empty())
	{
		printf("%d,",myqueue.front());
		myqueue.pop();
	}


	printf("\n\n-----------\n");

	return 0;
}
